import { Button } from 'antd';
import { useModel } from '@umijs/max';

export default (props: any) => {
  const { initialState: { elements } } = useModel('@@initialState') as any;
  return elements.includes(props.permission) && <Button {...props}>
    {props.children}
  </Button>;
};
